#include <cstdio>
#include <algorithm>

using namespace std;

long long a[ 5 ][ 201 ], b[ 40001 ], c[ 40001 ];
int m;

bool find( long long x )
{
    int l = 0, r = m - 1, mid;
    while ( l <= r )
    {
        mid = ( l + r ) / 2;
        if ( b[ mid ] == x ) return true;
        if ( b[ mid ] < x ) l = mid + 1;
        else r = mid - 1;
    }
    return false;
}

int main( )
{
    int t, i, j, k, n;
    bool flag;
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%d", &n);
        m = 0;
        for ( i = 0; i < 5; i++ )
            for ( j = 0; j < n; j++ )
                scanf("%I64d", &a[ i ][ j ]);
        for ( i = 0; i < n; i++ )
            for ( j = 0; j < n; j++ )
            {
                b[ m ] = a[ 0 ][ i ] + a[ 1 ][ j ];
                c[ m++ ] = a[ 2 ][ i ] + a[ 3 ][ j ];
            }
        sort( b, b + m );
        sort( c, c + m );
        flag = true;
        for ( i = 0; i < n; i++ )
        {
            j = 0; k = m - 1;
            while ( j < m )
            {
                while ( j < m && b[ j ] + c[ k ] < -a[ 4 ][ i ] ) j++;
                while ( k >= 0 && b[ j ] + c[ k ] > -a[ 4 ][ i ] ) k--;
                if ( b[ j ] + c[ k ] == -a[ 4 ][ i ] ) break;
                j++;
            }
            if ( j < m ) break;
        }
        if ( i >= n )
            puts("No");
        else
            puts("Yes");
    }
    return 0;
}
